using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Backend.JYD.AModel.Models.Mapping
{
    public class EstateMap : EntityTypeConfiguration<Estate>
    {
        public EstateMap()
        {
            // Primary Key
            this.HasKey(t => t.EstateId);

            // Properties
            this.Property(t => t.Address)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Estate");
            this.Property(t => t.EstateId).HasColumnName("EstateId");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Address).HasColumnName("Address");
            this.Property(t => t.UseType).HasColumnName("UseType");
            this.Property(t => t.MaketPrice).HasColumnName("MaketPrice");
            this.Property(t => t.EvalPrice).HasColumnName("EvalPrice");
            this.Property(t => t.IsPledge).HasColumnName("IsPledge");
            this.Property(t => t.PledgePrice).HasColumnName("PledgePrice");
            this.Property(t => t.OwnerType).HasColumnName("OwnerType");
        }
    }
}
